﻿jQuery(document).ready(function(){jQuery('.menuMyList li a').text('');jQuery(".loggedInUser").insertBefore('.menuMyList');jQuery("img, input, a").tipTip();jQuery(function($){jQuery('img.avatarimage').onImagesLoaded(function(_this){if(!jQuery.browser.msie){jQuery(_this).wrap(function(){return'<span class="AvatarWrap" style="position:relative; display:inline-block; background:url('+jQuery(_this).attr('src')+') no-repeat center center; width: auto; height: auto;" />'});jQuery(_this).css("opacity","0")}else{if(jQuery.browser.version>=9){jQuery(_this).wrap(function(){return'<span class="AvatarWrap" style="position:relative; display:inline-block; background:url('+jQuery(_this).attr('src')+') no-repeat center center; width: auto; height: auto;" />'});jQuery(_this).css("opacity","0")}}})})});

jQuery.fn.onImagesLoaded=function(_cb){return this.each(function(){var $imgs=(this.tagName.toLowerCase()==='img')?$(this):$('img',this),_cont=this,i=0,_done=function(){if(typeof _cb==='function')_cb(_cont)};if($imgs.length){$imgs.each(function(){var _img=this,_checki=function(e){if((_img.complete)||(_img.readyState=='complete'&&e.type=='readystatechange')){if(++i===$imgs.length)_done()}else if(_img.readyState===undefined){$(_img).attr('src',$(_img).attr('src'));}};$(_img).bind('load readystatechange',function(e){_checki(e)});_checki({type:'readystatechange'});})}else _done()})};